package UCM;

import Source.DisplayFlights;
import Views.ViewDisplayFlights;

/**
 * Use case for Display flights
 * @author Jason Sorbello
 */
public class UCDisplayFlights implements UCController {

    private ViewDisplayFlights view;
    private DisplayFlights model = new DisplayFlights();

    /**
     * Initualises the view
     * @param view
     */
    public UCDisplayFlights(ViewDisplayFlights view) {
        this.view = view;
        view.loadTo(model);
    }

    /**
     * Precondition: user is on main ui
     * 
     * 1. user clicks on display flights button
     * 2. system gets flight data
     * 3. system displays flights
     * 
     * Postcondition: flights are displayed
     */
    public void run() {
        //2. system gets flight data
        model.getData();
        //3. system displays flights
        view.setDisplayFlightsVisible();
    }
}
